<!--
*** Created by zhumin on 2023/09/18.***
*** Description: "报表详情页面"
-->
<template>
  <div>
    <common @getGroupData="getGroupData"></common>
    <div :class="['component-style', 'item']">
      <template v-if="activeItemName === '围棋'">
        <!-- 对阵表 -->
        <MSGO01 v-if="reportCode === 'MSGO01'"></MSGO01>
        <MSGO02 v-if="reportCode === 'MSGO02'"></MSGO02>
        <MSGO03 v-if="reportCode === 'MSGO03'"></MSGO03>
        <MSGO08 v-if="reportCode === 'MSGO08'"></MSGO08>

        <!-- 成绩公告 -->
        <MRGO01 v-if="reportCode === 'MRGO01'"></MRGO01>
        <MRGO02 v-if="reportCode === 'MRGO02'"></MRGO02>
        <MRGO03 v-if="reportCode === 'MRGO03'"></MRGO03>
        <MRGO08 v-if="reportCode === 'MRGO08'"></MRGO08>

        <!-- 综合成绩公告 -->
        <MRGO05 v-if="reportCode === 'MRGO05'"></MRGO05>
        <MRGO06 v-if="reportCode === 'MRGO06'"></MRGO06>
        <MRGO07 v-if="reportCode === 'MRGO07'"></MRGO07>
        <MRGO09 v-if="reportCode === 'MRGO09'"></MRGO09>
        <MRGO10 v-if="reportCode === 'MRGO10'"></MRGO10>
        <MRGO11 v-if="reportCode === 'MRGO11'"></MRGO11>
        <MRGO12 v-if="reportCode === 'MRGO12'"></MRGO12>
        <MRGO13 v-if="reportCode === 'MRGO13'"></MRGO13>
        <MRGO14 v-if="reportCode === 'MRGO14'"></MRGO14>
        <MRGO15 v-if="reportCode === 'MRGO15'"></MRGO15>
        <MRGO16 v-if="reportCode === 'MRGO16'"></MRGO16>
        <MRGO17 v-if="reportCode === 'MRGO17'"></MRGO17>
        <MRGO18 v-if="reportCode === 'MRGO18'"></MRGO18>
        <MRGO19 v-if="reportCode === 'MRGO19'"></MRGO19>

        <!-- 名次公告 -->
        <rank-g-o v-if="sportFileName === '名次公告' || sportFileName === '获奖名单'"></rank-g-o>
      </template>
      <template v-else-if="activeItemName === '国际象棋'">
        <!-- 对阵表 -->
        <MSCH01 v-if="reportCode === 'MSCH01'"></MSCH01>
        <MSCH02 v-if="reportCode === 'MSCH02'"></MSCH02>
        <MSCH03 v-if="reportCode === 'MSCH03'"></MSCH03>
        <MSCH04 v-if="reportCode === 'MSCH04'"></MSCH04>

        <!-- 成绩公告 -->
        <MRCH01 v-if="reportCode === 'MRCH01'"></MRCH01>
        <MRCH02 v-if="reportCode === 'MRCH02'"></MRCH02>

        <!-- 综合成绩公告 -->
        <MRCH03 v-if="reportCode === 'MRCH03'"></MRCH03>
        <MRCH04 v-if="reportCode === 'MRCH04'"></MRCH04>
        <MRCH05 v-if="reportCode === 'MRCH05'"></MRCH05>
        <MRCH06 v-if="reportCode === 'MRCH06'"></MRCH06>
        <MRCH07 v-if="reportCode === 'MRCH07'"></MRCH07>
        <MRCH08 v-if="reportCode === 'MRCH08'"></MRCH08>
        <MRCH09 v-if="reportCode === 'MRCH09'"></MRCH09>

        <!-- 名次公告 -->
        <rank-c-h v-if="sportFileName === '名次公告' || sportFileName === '获奖名单'"></rank-c-h>
      </template>
      <template v-else-if="activeItemName === '象棋'">
        <!-- 对阵表 -->
        <MSCC01 v-if="reportCode === 'MSCC01'"></MSCC01>
        <MSCC02 v-if="reportCode === 'MSCC02'"></MSCC02>

        <!-- 成绩公告 -->
        <MRCC01 v-if="reportCode === 'MRCC01'"></MRCC01>
        <MRCC02 v-if="reportCode === 'MRCC02'"></MRCC02>

        <!-- 综合成绩公告 -->
        <MRCC03 v-if="reportCode === 'MRCC03'"></MRCC03>
        <MRCC04 v-if="reportCode === 'MRCC04'"></MRCC04>
        <MRCC05 v-if="reportCode === 'MRCC05'"></MRCC05>
        <MRCC06 v-if="reportCode === 'MRCC06'"></MRCC06>
        <MRCC07 v-if="reportCode === 'MRCC07'"></MRCC07>

        <!-- 名次公告 -->
        <rank-c-c v-if="sportFileName === '名次公告' || sportFileName === '获奖名单'"></rank-c-c>
      </template>
      <template v-else-if="activeItemName === '国际跳棋'">
        <!-- 对阵表 -->
        <MSDR01 v-if="reportCode === 'MSDR01'"></MSDR01>
        <MSDR02 v-if="reportCode === 'MSDR02'"></MSDR02>
        <MSDR03 v-if="reportCode === 'MSDR03'"></MSDR03>

        <!-- 成绩公告 -->
        <MRDR01 v-if="reportCode === 'MRDR01'"></MRDR01>
        <MRDR02 v-if="reportCode === 'MRDR02'"></MRDR02>
        <MRDR05 v-if="reportCode === 'MRDR05'"></MRDR05>

        <!-- 综合成绩公告 -->
        <MRDR03 v-if="reportCode === 'MRDR03'"></MRDR03>
        <MRDR04 v-if="reportCode === 'MRDR04'"></MRDR04>
        <MRDR06 v-if="reportCode === 'MRDR06'"></MRDR06>

        <!-- 名次公告 -->
        <rank-d-r v-if="sportFileName === '名次公告' || sportFileName === '获奖名单'"></rank-d-r>
      </template>
      <template v-else-if="activeItemName === '桥牌'">
        <!-- 对阵表 -->
        <MSBR02 v-if="reportCode === 'MSBR02'"></MSBR02>
        <MSBR03 v-if="reportCode === 'MSBR03'"></MSBR03>
        <MSBR04 v-if="reportCode === 'MSBR04'"></MSBR04>
        <MSBR05 v-if="reportCode === 'MSBR05'"></MSBR05>

        <!-- 成绩公告 -->
        <MRBR02 v-if="reportCode === 'MRBR02'"></MRBR02>
        <MRBR03 v-if="reportCode === 'MRBR03'"></MRBR03>
        <MRBR04 v-if="reportCode === 'MRBR04'"></MRBR04>
        <MRBR05 v-if="reportCode === 'MRBR05'"></MRBR05>
        <MRBR06 v-if="reportCode === 'MRBR06'"></MRBR06>

        <!-- 综合成绩公告 -->
        <MRBR01 v-if="reportCode === 'MRBR01'"></MRBR01>
        <MRBR07 v-if="reportCode === 'MRBR07'"></MRBR07>
        <MRBR08 v-if="reportCode === 'MRBR08'"></MRBR08>
        <MRBR09 v-if="reportCode === 'MRBR09'"></MRBR09>
        <MRBR10 v-if="reportCode === 'MRBR10'"></MRBR10>
        <MRBR11 v-if="reportCode === 'MRBR11'"></MRBR11>
        <MRBR12 v-if="reportCode === 'MRBR12'"></MRBR12>
        <MRBR13 v-if="reportCode === 'MRBR13'"></MRBR13>
        <MRBR14 v-if="reportCode === 'MRBR14'"></MRBR14>
        <MRBR15 v-if="reportCode === 'MRBR15'"></MRBR15>
        <MRBR16 v-if="reportCode === 'MRBR16'"></MRBR16>

        <!-- 名次公告 -->
        <rank-b-r v-if="sportFileName === '名次公告' || sportFileName === '获奖名单'"></rank-b-r>
      </template>
      <template v-else-if="activeItemName === '五子棋'">
        <!-- 对阵表 -->
        <MSGB01 v-if="reportCode === 'MSGB01'"></MSGB01>
        <MSGB02 v-if="reportCode === 'MSGB02'"></MSGB02>
        <MSGB03 v-if="reportCode === 'MSGB03'"></MSGB03>

        <!-- 成绩公告 -->
        <MRGB01 v-if="reportCode === 'MRGB01'"></MRGB01>
        <MRGB02 v-if="reportCode === 'MRGB02'"></MRGB02>
        <MRGB03 v-if="reportCode === 'MRGB03'"></MRGB03>
        <MRGB04 v-if="reportCode === 'MRGB04'"></MRGB04>

        <!-- 综合成绩公告 -->
        <MRGB05 v-if="reportCode === 'MRGB05'"></MRGB05>
        <MRGB06 v-if="reportCode === 'MRGB06'"></MRGB06>
        <MRGB07 v-if="reportCode === 'MRGB07'"></MRGB07>
        <MRGB08 v-if="reportCode === 'MRGB08'"></MRGB08>
        <MRGB09 v-if="reportCode === 'MRGB09'"></MRGB09>
        <MRGB10 v-if="reportCode === 'MRGB10'"></MRGB10>
        <MRGB11 v-if="reportCode === 'MRGB11'"></MRGB11>
        <MRGB12 v-if="reportCode === 'MRGB12'"></MRGB12>

        <!-- 名次公告 -->
        <rank-g-b v-if="sportFileName === '名次公告' || sportFileName === '获奖名单'"></rank-g-b>
      </template>
      <template v-else-if="activeItemName === '掼蛋' || activeItemName === '掼牌（掼蛋）'">
        <!-- 对阵表 -->
        <MSWE01 v-if="reportCode === 'MSWE01'"></MSWE01>

        <!-- 成绩公告 -->
        <MRWE01 v-if="reportCode === 'MRWE01'"></MRWE01>

        <!-- 综合成绩公告 -->
        <MRWE02 v-if="reportCode === 'MRWE02'"></MRWE02>
        <MRWE03 v-if="reportCode === 'MRWE03'"></MRWE03>
        <MRWE04 v-if="reportCode === 'MRWE04'"></MRWE04>
        <MRWE05 v-if="reportCode === 'MRWE05'"></MRWE05>
        <MRWE06 v-if="reportCode === 'MRWE06'"></MRWE06>

        <!-- 名次公告 -->
        <rank-w-e v-if="sportFileName === '名次公告' || sportFileName === '获奖名单'"></rank-w-e>
      </template>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
import Util from '@/assets/js/util'
import Storage from '@/assets/js/storage'

export default {
  created() {
    this.activeItemName = this.$route.query.activeItemName || '围棋'
    this.sportFileName = this.$route.query.sportFileName || '' // 判断是否展示秩序单和成绩公告数
    this.filePath = this.$route.query.filePath
    if (this.sportFileName !== '名次公告' && this.sportFileName !== '获奖名单') {
      this.getReportData()
    }
  },
  mounted() {},
  data() {
    return {
      sportFileName: '对阵表',
      activeItemName: '围棋',
      reportCode: '',
      filePath: ''
    }
  },
  watch: {},
  computed: {
    ...mapState({})
  },
  filters: {},
  components: {},
  methods: {
    getReportData() {
      this.$store
        .dispatch('getReportData', this.filePath + '.txt')
        .then(res => {
          this.reportCode = res.Code
        })
        .catch(error => {
          console.log(error)
        })
    },
    getGroupData(data) {
      this.$router.push({
        name: 'itemDetail'
      })
    }
  }
}
</script>
<style scoped lang="scss">
@import '@/assets/scss/item.scss';
</style>
